var type=GetQueryString('type');

$(document).ready(function () { 
	//八音分类
	var byJson = ajaxResult("get",false,"MbXtglBaseTableServlet.getPullData.do",{'tn':'mb_gy_byfl'});
	loadSelect("#class_bayin",byJson.rows,'id','name');
	createTable('#tbl_datalist','../mbgcxxservlet.getMusicList.do','zdbh',tblColTitle,null,null);
	$("#query_btn").click(function(){
		refreshTable("#tbl_datalist","#form_query");
	});
	
	$('#MusicDetail').on('hide.bs.modal', function () {
		var audio = $("#dataAddframe").contents().find("audio").click();
		$.each(audio, function(idx, obj) {
			obj.pause();
		});
	});
});
function showDetail(id){
	$('#dataAddframe').attr('src','dataInfo.html?id='+id);
	$("#MusicDetail").modal('show');
}

var tblColTitle = [ 
	
	{ title: '藏品编号', field: 'collection_code' },
	{ title: '馆藏编码', field: 'holding_code' },
	{ title: '乐器名称', field: 'title' },
	{ title: '音标', field: 'phoneticSymbol' },
	{ title: '出生地', field: 'unearthedPlace' },
	{ title: '年代', field: 'year_text' },
	{ title: '八音分类', field: 'class_bayin_text' },
	{ title: '民间分类', field: 'class_minjian_text' },
	{ title: '霍萨分类', field: 'class_huosa_text' },
	{ title: '语源', field: 'language_text' },
	{ title: '使用种族', field: 'useNation_text' },
	{ title: '操作', field: '', formatter: function (value, row, index) {
		 var result="";
		 result="<a href='#' onclick='showDetail("+row.id+")' data-toggle='modal' data-target='#exampleModal2'>详情信息</a>";
		 return result;
	}}
];


function showhsfl(){
	initSelectModel("Hs","选择霍萨分类","class_huosa",1)
}

function showmjfl(){
	initSelectModel("Mj","选择民间分类","class_minjian",1)
}